3.191 \(\int \frac{\tan (x)}{\sec (x)+\tan (x)} \, dx\)

Optimal. Leaf size=11 \[ x+\frac{\cos (x)}{\sin (x)+1} \]

[Out]

x + Cos[x]/(1 + Sin[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0528004, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3, Rules used = {4391, 2735, 2648} \[ x+\frac{\cos (x)}{\sin (x)+1} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]/(Sec[x] + Tan[x]),x]

[Out]

x + Cos[x]/(1 + Sin[x])

Rule 4391

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin{align*} \int \frac{\tan (x)}{\sec (x)+\tan (x)} \, dx &=\int \frac{\sin (x)}{1+\sin (x)} \, dx\\ &=x-\int \frac{1}{1+\sin (x)} \, dx\\ &=x+\frac{\cos (x)}{1+\sin (x)}\\ \end{align*}

Mathematica [B]  time = 0.0336051, size = 25, normalized size = 2.27 \[ x-\frac{2 \sin \left (\frac{x}{2}\right )}{\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]/(Sec[x] + Tan[x]),x]

[Out]

x - (2*Sin[x/2])/(Cos[x/2] + Sin[x/2])

________________________________________________________________________________________

Maple [A]  time = 0.065, size = 13, normalized size = 1.2 \begin{align*} 2\, \left ( \tan \left ( x/2 \right ) +1 \right ) ^{-1}+x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(sec(x)+tan(x)),x)

[Out]

2/(tan(1/2*x)+1)+x

________________________________________________________________________________________

Maxima [B]  time = 1.66223, size = 38, normalized size = 3.45 \begin{align*} \frac{2}{\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1} + 2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)+tan(x)),x, algorithm="maxima")

[Out]

2/(sin(x)/(cos(x) + 1) + 1) + 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

Fricas [B]  time = 0.464028, size = 88, normalized size = 8. \begin{align*} \frac{{\left (x + 1\right )} \cos \left (x\right ) +{\left (x - 1\right )} \sin \left (x\right ) + x + 1}{\cos \left (x\right ) + \sin \left (x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)+tan(x)),x, algorithm="fricas")

[Out]

((x + 1)*cos(x) + (x - 1)*sin(x) + x + 1)/(cos(x) + sin(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan{\left (x \right )}}{\tan{\left (x \right )} + \sec{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)+tan(x)),x)

[Out]

Integral(tan(x)/(tan(x) + sec(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.12496, size = 16, normalized size = 1.45 \begin{align*} x + \frac{2}{\tan \left (\frac{1}{2} \, x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(sec(x)+tan(x)),x, algorithm="giac")

[Out]

x + 2/(tan(1/2*x) + 1)